import java.util.Arrays;

import static java.util.List.copyOf;

public class test {

    public static void main(String[] args) {
        int[][] arr = {{1, 2, 3}, {4, 5, 6}};
        for (int[] tmp : arr) {
            for (int x : tmp) {
                System.out.print(x + " ");
            }

            System.out.println();
        }
    }

    /*public static void main(String[] args) {

        int[][] arr1 = new int[2][3];
        int[][] arr2 = new int[][]{{1, 2, 3}, {4, 5, 6}};

        int[][] arr = {{1, 2, 3}, {4, 5, 6}};
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
    }*/

    /*public static void main(String[] args) {
        int[] array1 = {1,2,3,4,5,6,7,18,9};
        int[] array2 = {1,2,3,4,5,6,7,18,9,20};

        boolean flg = Arrays.equals(array1,array2);
        System.out.println(flg);
        boolean flg = Arrays.equals(array1,array2);

        int[]array3 = new int[10];
        int[]array3 = new int[10];
        Arrays.fill(array3,0,arrays.length,-1);
        Arrays.fill(array3,3,6,-1);//[3,5)
        System.out.println(Arrays.toString(array3));
    }*/

    /*public static void main(String[] args) {
        int[] array = {9,8,7,6,5,4,3,2,1};
        //Arrays.sort(array);
        //System.out.println(Arrays.toString(array));
        System.out.println(Arrays.binarySearch(array,7));



        //System.out.println(binarySearch(array, 9));
    }*/

    /*public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        int sum=0;
        for (int x :array) {
            sum+=x;
        }
        System.out.println(sum * 1.0 / array.length);
    }*/


    /*public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9};
        //int[]arr1 =Arrays.copyOf(array,array.length);
        //int[]arr1 =Arrays.copyOfRange(array,3,6);
        int[] copy = new int[array.length];
        System.arraycopy(array,2,copy,2,array.length-2);
        System.out.println(Arrays.toString(copy));
    }*/


/*
    public static int[] copyOf(int[] array) {
        int[] copy = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            copy[i] = array[i];
        }
        return copy;
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4};
        int[] copy = copyOf(array);
        System.out.println(Arrays.toString(copy));

        int[] array2 = {1,2,3,4};
        int[] array3 = array2;

        System.out.println(Arrays.toString(array3));
    }


    public static int[] fib(int x) {
        if (x <= 0) {
            return null;
        }
        int[] arr = new int[x];
        arr[0] = arr[1] = 1;
        for (int i = 2; i < arr.length; i++) {
            arr[i] = arr[i - 1] + arr[i - 2];
        }
        return arr;

    }

    public static void main6(String[] args) {
        int[] array = fib(10);
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
    }

    public static void fun(int[] x) {
        *//*x=0;
        System.out.println(x);*//*
        x[0] = 100;
        x[1] = 200;
    }

    public static void main5(String[] args) {
        *//*int num=10;
        fun(num);
        System.out.println(num);*//*

        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        fun(arr);
        print(arr);
    }

    *//*public static void fun(int[] x){
        x=0;
        System.out.println(x);


        *//**//*arr[0]=100;
        arr[1]=200;
        arr[2]=300;
        arr[3]=400;
        print(arr);*//**//*

     *//**//* for (int i = 0; i <arr.length ; i++) {
            System.out.print(arr[i]+" ");
        }
        System.out.println();*//**//*
    }*//*

    public static void main4(String[] args) {
        int[] arr1 = new int[]{1, 2, 3, 4};
        //fun(arr1);
        String ret = Arrays.toString(arr1);
        System.out.println(ret);
        System.out.println(Arrays.toString(arr1));
        arr1 = null;
        int[] arr2 = null;
        *//*System.out.println(arr1[0]);
        System.out.println(arr1[1]);
        System.out.println(arr1[2]);
        System.out.println(arr1[3]);

        arr1[0]=100;
        System.out.println(arr1[0]);

        print(arr1);*//*
    }


    public static void main3(String[] args) {

        *//*int[] arr=null;
        //int[20]arr1={1,2,3,4,5};  不可以
        int[]arr1=new int[30];//这样设置数组大小可行
        *//*

        int[] arr1;
        arr1 = new int[10];
        print(arr1);

        boolean[] arr3;
        arr1 = new int[10];
        print(arr1);

        int[] arr2;
        arr2 = new int[]{1, 2, 3, 4};
        print(arr2);
       *//* int[]arr2;
        arr2={1,2,3,4}*//*


     *//*double[] arr={1.1,2.2,3.3,4.4};
        for (double x:arr) {
            System.out.print(x+" ");
        }
        System.out.println();*//*
    }

    public static void print(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }


    public static void main2(String[] args) {
        int[] arr1 = {1, 2, 3, 4};
        print(arr1);
        int[] arr2 = new int[]{11, 22, 33, 44};
        print(arr2);
        arr1 = arr2;
        System.out.print("arr1: ");
        print(arr1);
        System.out.print("arr2: ");
        print(arr2);

    }


    public static String myToString(int[] array) {
        String str = "[";
        for (int i = 0; i < array.length; i++) {
            str = str + array[i];
            if (i != array.length - 1) {
                str = str + ",";
            }
        }
        str = str + "]";
        return str;
    }


    public static void main1(String[] args) {
        int[] array = {1, 2, 3, 4};
        String ret = myToString(array);
        System.out.println(ret);
    }*/
}